package com.sun.entitys.users;


import com.sun.entitys.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * MP自动填充Handler
 *
 * @Author sun
 * @CreateTime 2025/9/6 19:19
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "t_role")
public class Role extends BaseEntity {
    @ManyToMany
    @JoinTable(name = "t_role_menu", joinColumns = @JoinColumn(name = "roleId"), inverseJoinColumns = @JoinColumn(name = "menuId"))
    private List<Menu> menus;
    @ManyToMany
    @JoinTable(name = "t_role_permission", joinColumns = @JoinColumn(name = "roleId"), inverseJoinColumns = @JoinColumn(name = "permissionId"))
    private List<Permission> permissions;


}
